package com.coderg.gmall.oauth2.controller;

import com.coderg.gmall.model.user.UserInfo;
import com.coderg.gmall.oauth2.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/user")
public class UserController {

    @Autowired
    private UserInfoService userInfoService;
    /**
     * 查询用户信息
     * @return
     */
    @GetMapping(value = "/getUserInfo/{username}")
    public UserInfo getUserInfo(@PathVariable(value = "username") String username){
        return userInfoService.getUserInfo(username);
    }




}
